<!-- HTML header for doxygen 1.8.6-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<title>OpenCV: cv::LineIterator Class Reference</title>
<link href="../../opencv.ico" rel="shortcut icon" type="image/x-icon" />
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<script type="text/javascript" src="../../tutorial-utils.js"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
//<![CDATA[
MathJax.Hub.Config(
{
  TeX: {
      Macros: {
          matTT: [ "\\[ \\left|\\begin{array}{ccc} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \\end{array}\\right| \\]", 9],
          fork: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ \\end{array} \\right.", 4],
          forkthree: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ #5 & \\mbox{#6}\\\\ \\end{array} \\right.", 6],
          forkfour: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ #5 & \\mbox{#6}\\\\ #7 & \\mbox{#8}\\\\ \\end{array} \\right.", 8],
          vecthree: ["\\begin{bmatrix} #1\\\\ #2\\\\ #3 \\end{bmatrix}", 3],
          vecthreethree: ["\\begin{bmatrix} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \\end{bmatrix}", 9],
          cameramatrix: ["#1 = \\begin{bmatrix} f_x & 0 & c_x\\\\ 0 & f_y & c_y\\\\ 0 & 0 & 1 \\end{bmatrix}", 1],
          distcoeffs: ["(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \\tau_x, \\tau_y]]]]) \\text{ of 4, 5, 8, 12 or 14 elements}"],
          distcoeffsfisheye: ["(k_1, k_2, k_3, k_4)"],
          hdotsfor: ["\\dots", 1],
          mathbbm: ["\\mathbb{#1}", 1],
          bordermatrix: ["\\matrix{#1}", 1]
      }
  }
}
);
//]]>
</script><script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
<link href="../../stylesheet.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<!--#include virtual="/google-search.html"-->
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="../../opencv-logo-small.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">OpenCV
   &#160;<span id="projectnumber">4.5.2</span>
   </div>
   <div id="projectbrief">Open Source Computer Vision</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
<script type="text/javascript" src="../../menudata.js"></script>
<script type="text/javascript" src="../../menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('../../',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="../../d2/d75/namespacecv.html">cv</a></li><li class="navelem"><a class="el" href="../../dc/dd2/classcv_1_1LineIterator.html">LineIterator</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a> &#124;
<a href="../../dd/d2c/classcv_1_1LineIterator-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">cv::LineIterator Class Reference<div class="ingroups"><a class="el" href="../../d7/dbd/group__imgproc.html">Image Processing</a> &raquo; <a class="el" href="../../d6/d6e/group__imgproc__draw.html">Drawing Functions</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>Line iterator.  
 <a href="../../dc/dd2/classcv_1_1LineIterator.html#details">More...</a></p>

<p><code>#include &lt;opencv2/imgproc.hpp&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ac83a4c574ce6a50a78a52d7eee10371b"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/dd2/classcv_1_1LineIterator.html#ac83a4c574ce6a50a78a52d7eee10371b">LineIterator</a> (const <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> &amp;img, <a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a> pt1, <a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a> pt2, int connectivity=8, bool leftToRight=false)</td></tr>
<tr class="memdesc:ac83a4c574ce6a50a78a52d7eee10371b"><td class="mdescLeft">&#160;</td><td class="mdescRight">initializes the iterator  <a href="#ac83a4c574ce6a50a78a52d7eee10371b">More...</a><br /></td></tr>
<tr class="separator:ac83a4c574ce6a50a78a52d7eee10371b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a77c1558a5b659fb3e039f2d4002ecfd9"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/dd2/classcv_1_1LineIterator.html#a77c1558a5b659fb3e039f2d4002ecfd9">LineIterator</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a> pt1, <a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a> pt2, int connectivity=8, bool leftToRight=false)</td></tr>
<tr class="separator:a77c1558a5b659fb3e039f2d4002ecfd9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac8a3586d10fad1b1326dbf7988e2beb1"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/dd2/classcv_1_1LineIterator.html#ac8a3586d10fad1b1326dbf7988e2beb1">LineIterator</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga346f563897249351a34549137c8532a0">Size</a> boundingAreaSize, <a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a> pt1, <a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a> pt2, int connectivity=8, bool leftToRight=false)</td></tr>
<tr class="separator:ac8a3586d10fad1b1326dbf7988e2beb1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af4dcab5426fe8d879932f1b2d35a6367"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/dd2/classcv_1_1LineIterator.html#af4dcab5426fe8d879932f1b2d35a6367">LineIterator</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga11d95de507098e90bad732b9345402e8">Rect</a> boundingAreaRect, <a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a> pt1, <a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a> pt2, int connectivity=8, bool leftToRight=false)</td></tr>
<tr class="separator:af4dcab5426fe8d879932f1b2d35a6367"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a278f4f6d0ff9bef5193789af647c421e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/dd2/classcv_1_1LineIterator.html#a278f4f6d0ff9bef5193789af647c421e">init</a> (const <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> *img, <a class="el" href="../../dc/d84/group__core__basic.html#ga11d95de507098e90bad732b9345402e8">Rect</a> boundingAreaRect, <a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a> pt1, <a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a> pt2, int connectivity, bool leftToRight)</td></tr>
<tr class="separator:a278f4f6d0ff9bef5193789af647c421e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a11df3b7dbaf0e16ddb430eab3b62e78f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../d1/d1b/group__core__hal__interface.html#ga65f85814a8290f9797005d3b28e7e5fc">uchar</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/dd2/classcv_1_1LineIterator.html#a11df3b7dbaf0e16ddb430eab3b62e78f">operator*</a> ()</td></tr>
<tr class="memdesc:a11df3b7dbaf0e16ddb430eab3b62e78f"><td class="mdescLeft">&#160;</td><td class="mdescRight">returns pointer to the current pixel  <a href="#a11df3b7dbaf0e16ddb430eab3b62e78f">More...</a><br /></td></tr>
<tr class="separator:a11df3b7dbaf0e16ddb430eab3b62e78f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a70052c25251e3387d8ab80d86febef95"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../dc/dd2/classcv_1_1LineIterator.html">LineIterator</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/dd2/classcv_1_1LineIterator.html#a70052c25251e3387d8ab80d86febef95">operator++</a> ()</td></tr>
<tr class="memdesc:a70052c25251e3387d8ab80d86febef95"><td class="mdescLeft">&#160;</td><td class="mdescRight">prefix increment operator (++it). shifts iterator to the next pixel  <a href="#a70052c25251e3387d8ab80d86febef95">More...</a><br /></td></tr>
<tr class="separator:a70052c25251e3387d8ab80d86febef95"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a79c1edcfb30865c5abec03e48f91bcdc"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../dc/dd2/classcv_1_1LineIterator.html">LineIterator</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/dd2/classcv_1_1LineIterator.html#a79c1edcfb30865c5abec03e48f91bcdc">operator++</a> (int)</td></tr>
<tr class="memdesc:a79c1edcfb30865c5abec03e48f91bcdc"><td class="mdescLeft">&#160;</td><td class="mdescRight">postfix increment operator (it++). shifts iterator to the next pixel  <a href="#a79c1edcfb30865c5abec03e48f91bcdc">More...</a><br /></td></tr>
<tr class="separator:a79c1edcfb30865c5abec03e48f91bcdc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afeddb548b519ef727e3d07b2361cd8e1"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/dd2/classcv_1_1LineIterator.html#afeddb548b519ef727e3d07b2361cd8e1">pos</a> () const</td></tr>
<tr class="memdesc:afeddb548b519ef727e3d07b2361cd8e1"><td class="mdescLeft">&#160;</td><td class="mdescRight">returns coordinates of the current pixel  <a href="#afeddb548b519ef727e3d07b2361cd8e1">More...</a><br /></td></tr>
<tr class="separator:afeddb548b519ef727e3d07b2361cd8e1"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:a78e06b7798ab056aba770b6e49c549b4"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/dd2/classcv_1_1LineIterator.html#a78e06b7798ab056aba770b6e49c549b4">count</a></td></tr>
<tr class="separator:a78e06b7798ab056aba770b6e49c549b4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa012621795cee84b02dd63dee0d2a70b"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/dd2/classcv_1_1LineIterator.html#aa012621795cee84b02dd63dee0d2a70b">elemSize</a></td></tr>
<tr class="separator:aa012621795cee84b02dd63dee0d2a70b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a37cf77db73ddf2eaace21028c99b0cf7"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/dd2/classcv_1_1LineIterator.html#a37cf77db73ddf2eaace21028c99b0cf7">err</a></td></tr>
<tr class="separator:a37cf77db73ddf2eaace21028c99b0cf7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad8c1822684034533a52969c837e5f96c"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/dd2/classcv_1_1LineIterator.html#ad8c1822684034533a52969c837e5f96c">minusDelta</a></td></tr>
<tr class="separator:ad8c1822684034533a52969c837e5f96c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad9effab1755fb1c96e04bac1d3557a7c"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/dd2/classcv_1_1LineIterator.html#ad9effab1755fb1c96e04bac1d3557a7c">minusShift</a></td></tr>
<tr class="separator:ad9effab1755fb1c96e04bac1d3557a7c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a293eafffedcac965ae5d7fb7fc8d8345"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/dd2/classcv_1_1LineIterator.html#a293eafffedcac965ae5d7fb7fc8d8345">minusStep</a></td></tr>
<tr class="separator:a293eafffedcac965ae5d7fb7fc8d8345"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad3f28c0cbd51d1a08b44d6c55ae92a28"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/dd2/classcv_1_1LineIterator.html#ad3f28c0cbd51d1a08b44d6c55ae92a28">p</a></td></tr>
<tr class="separator:ad3f28c0cbd51d1a08b44d6c55ae92a28"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a364babc688c58ba62ea0cad61a65f07b"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/dd2/classcv_1_1LineIterator.html#a364babc688c58ba62ea0cad61a65f07b">plusDelta</a></td></tr>
<tr class="separator:a364babc688c58ba62ea0cad61a65f07b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad750408a2774a499f6b08045f7b8e59e"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/dd2/classcv_1_1LineIterator.html#ad750408a2774a499f6b08045f7b8e59e">plusShift</a></td></tr>
<tr class="separator:ad750408a2774a499f6b08045f7b8e59e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adb7f1c0c3e722d9e87230b92e7b9f773"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/dd2/classcv_1_1LineIterator.html#adb7f1c0c3e722d9e87230b92e7b9f773">plusStep</a></td></tr>
<tr class="separator:adb7f1c0c3e722d9e87230b92e7b9f773"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6fe1f4e8d925bf60ca35255d765d83d1"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/dd2/classcv_1_1LineIterator.html#a6fe1f4e8d925bf60ca35255d765d83d1">ptmode</a></td></tr>
<tr class="separator:a6fe1f4e8d925bf60ca35255d765d83d1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9fc3f91adc5a20c6841c083cc89178d3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../d1/d1b/group__core__hal__interface.html#ga65f85814a8290f9797005d3b28e7e5fc">uchar</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/dd2/classcv_1_1LineIterator.html#a9fc3f91adc5a20c6841c083cc89178d3">ptr</a></td></tr>
<tr class="separator:a9fc3f91adc5a20c6841c083cc89178d3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acc76bbdcf947d3040d9b6d0e0ca27714"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="../../d1/d1b/group__core__hal__interface.html#ga65f85814a8290f9797005d3b28e7e5fc">uchar</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/dd2/classcv_1_1LineIterator.html#acc76bbdcf947d3040d9b6d0e0ca27714">ptr0</a></td></tr>
<tr class="separator:acc76bbdcf947d3040d9b6d0e0ca27714"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad01672bb85b10aff6f89dfcd93b618f5"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/dd2/classcv_1_1LineIterator.html#ad01672bb85b10aff6f89dfcd93b618f5">step</a></td></tr>
<tr class="separator:ad01672bb85b10aff6f89dfcd93b618f5"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Line iterator. </p>
<p>The class is used to iterate over all the pixels on the raster line segment connecting two specified points.</p>
<p>The class <a class="el" href="../../dc/dd2/classcv_1_1LineIterator.html" title="Line iterator. ">LineIterator</a> is used to get each pixel of a raster line. It can be treated as versatile implementation of the Bresenham algorithm where you can stop at each pixel and do some extra processing, for example, grab pixel values along the line or draw a line with an effect (for example, with XOR operation).</p>
<p>The number of pixels along the line is stored in <a class="el" href="../../dc/dd2/classcv_1_1LineIterator.html#a78e06b7798ab056aba770b6e49c549b4">LineIterator::count</a>. The method <a class="el" href="../../dc/dd2/classcv_1_1LineIterator.html#afeddb548b519ef727e3d07b2361cd8e1" title="returns coordinates of the current pixel ">LineIterator::pos</a> returns the current position in the image:</p>
<div class="fragment"><div class="line"><span class="comment">// grabs pixels along the line (pt1, pt2)</span></div><div class="line"><span class="comment">// from 8-bit 3-channel image to the buffer</span></div><div class="line"><a class="code" href="../../dc/dd2/classcv_1_1LineIterator.html#ac83a4c574ce6a50a78a52d7eee10371b">LineIterator</a> it(img, pt1, pt2, 8);</div><div class="line"><a class="code" href="../../dc/dd2/classcv_1_1LineIterator.html#ac83a4c574ce6a50a78a52d7eee10371b">LineIterator</a> it2 = it;</div><div class="line">vector&lt;Vec3b&gt; buf(it.count);</div><div class="line"></div><div class="line"><span class="keywordflow">for</span>(<span class="keywordtype">int</span> i = 0; i &lt; it.count; i++, ++it)</div><div class="line">    buf[i] = *(<span class="keyword">const</span> <a class="code" href="../../dc/d84/group__core__basic.html#ga7e6060c0b8d48459964df6e1eb524c03">Vec3b</a>*)*it;</div><div class="line"></div><div class="line"><span class="comment">// alternative way of iterating through the line</span></div><div class="line"><span class="keywordflow">for</span>(<span class="keywordtype">int</span> i = 0; i &lt; it2.count; i++, ++it2)</div><div class="line">{</div><div class="line">    <a class="code" href="../../dc/d84/group__core__basic.html#ga7e6060c0b8d48459964df6e1eb524c03">Vec3b</a> val = img.at&lt;<a class="code" href="../../dc/d84/group__core__basic.html#ga7e6060c0b8d48459964df6e1eb524c03">Vec3b</a>&gt;(it2.pos());</div><div class="line">    <a class="code" href="../../db/de0/group__core__utils.html#gaf62bcd90f70e275191ab95136d85906b">CV_Assert</a>(buf[i] == val);</div><div class="line">}</div></div><!-- fragment --> </div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="ac83a4c574ce6a50a78a52d7eee10371b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac83a4c574ce6a50a78a52d7eee10371b">&#9670;&nbsp;</a></span>LineIterator() <span class="overload">[1/4]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">cv::LineIterator::LineIterator </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> &amp;&#160;</td>
          <td class="paramname"><em>img</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a>&#160;</td>
          <td class="paramname"><em>pt1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a>&#160;</td>
          <td class="paramname"><em>pt2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>connectivity</em> = <code>8</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>leftToRight</em> = <code>false</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>initializes the iterator </p>
<p>creates iterators for the line connecting pt1 and pt2 the line will be clipped on the image boundaries the line is 8-connected or 4-connected If leftToRight=true, then the iteration is always done from the left-most point to the right most, not to depend on the ordering of pt1 and pt2 parameters; </p>

</div>
</div>
<a id="a77c1558a5b659fb3e039f2d4002ecfd9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a77c1558a5b659fb3e039f2d4002ecfd9">&#9670;&nbsp;</a></span>LineIterator() <span class="overload">[2/4]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">cv::LineIterator::LineIterator </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a>&#160;</td>
          <td class="paramname"><em>pt1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a>&#160;</td>
          <td class="paramname"><em>pt2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>connectivity</em> = <code>8</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>leftToRight</em> = <code>false</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<a id="ac8a3586d10fad1b1326dbf7988e2beb1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac8a3586d10fad1b1326dbf7988e2beb1">&#9670;&nbsp;</a></span>LineIterator() <span class="overload">[3/4]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">cv::LineIterator::LineIterator </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga346f563897249351a34549137c8532a0">Size</a>&#160;</td>
          <td class="paramname"><em>boundingAreaSize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a>&#160;</td>
          <td class="paramname"><em>pt1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a>&#160;</td>
          <td class="paramname"><em>pt2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>connectivity</em> = <code>8</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>leftToRight</em> = <code>false</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<a id="af4dcab5426fe8d879932f1b2d35a6367"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af4dcab5426fe8d879932f1b2d35a6367">&#9670;&nbsp;</a></span>LineIterator() <span class="overload">[4/4]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">cv::LineIterator::LineIterator </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga11d95de507098e90bad732b9345402e8">Rect</a>&#160;</td>
          <td class="paramname"><em>boundingAreaRect</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a>&#160;</td>
          <td class="paramname"><em>pt1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a>&#160;</td>
          <td class="paramname"><em>pt2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>connectivity</em> = <code>8</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>leftToRight</em> = <code>false</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a278f4f6d0ff9bef5193789af647c421e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a278f4f6d0ff9bef5193789af647c421e">&#9670;&nbsp;</a></span>init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::LineIterator::init </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> *&#160;</td>
          <td class="paramname"><em>img</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga11d95de507098e90bad732b9345402e8">Rect</a>&#160;</td>
          <td class="paramname"><em>boundingAreaRect</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a>&#160;</td>
          <td class="paramname"><em>pt1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a>&#160;</td>
          <td class="paramname"><em>pt2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>connectivity</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>leftToRight</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a11df3b7dbaf0e16ddb430eab3b62e78f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a11df3b7dbaf0e16ddb430eab3b62e78f">&#9670;&nbsp;</a></span>operator*()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../d1/d1b/group__core__hal__interface.html#ga65f85814a8290f9797005d3b28e7e5fc">uchar</a>* cv::LineIterator::operator* </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>returns pointer to the current pixel </p>

</div>
</div>
<a id="a70052c25251e3387d8ab80d86febef95"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a70052c25251e3387d8ab80d86febef95">&#9670;&nbsp;</a></span>operator++() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../dc/dd2/classcv_1_1LineIterator.html">LineIterator</a>&amp; cv::LineIterator::operator++ </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>prefix increment operator (++it). shifts iterator to the next pixel </p>

</div>
</div>
<a id="a79c1edcfb30865c5abec03e48f91bcdc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a79c1edcfb30865c5abec03e48f91bcdc">&#9670;&nbsp;</a></span>operator++() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../dc/dd2/classcv_1_1LineIterator.html">LineIterator</a> cv::LineIterator::operator++ </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>postfix increment operator (it++). shifts iterator to the next pixel </p>

</div>
</div>
<a id="afeddb548b519ef727e3d07b2361cd8e1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afeddb548b519ef727e3d07b2361cd8e1">&#9670;&nbsp;</a></span>pos()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a> cv::LineIterator::pos </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>returns coordinates of the current pixel </p>

</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a id="a78e06b7798ab056aba770b6e49c549b4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a78e06b7798ab056aba770b6e49c549b4">&#9670;&nbsp;</a></span>count</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int cv::LineIterator::count</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="aa012621795cee84b02dd63dee0d2a70b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa012621795cee84b02dd63dee0d2a70b">&#9670;&nbsp;</a></span>elemSize</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int cv::LineIterator::elemSize</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a37cf77db73ddf2eaace21028c99b0cf7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a37cf77db73ddf2eaace21028c99b0cf7">&#9670;&nbsp;</a></span>err</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int cv::LineIterator::err</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="ad8c1822684034533a52969c837e5f96c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad8c1822684034533a52969c837e5f96c">&#9670;&nbsp;</a></span>minusDelta</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int cv::LineIterator::minusDelta</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="ad9effab1755fb1c96e04bac1d3557a7c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad9effab1755fb1c96e04bac1d3557a7c">&#9670;&nbsp;</a></span>minusShift</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int cv::LineIterator::minusShift</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a293eafffedcac965ae5d7fb7fc8d8345"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a293eafffedcac965ae5d7fb7fc8d8345">&#9670;&nbsp;</a></span>minusStep</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int cv::LineIterator::minusStep</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="ad3f28c0cbd51d1a08b44d6c55ae92a28"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad3f28c0cbd51d1a08b44d6c55ae92a28">&#9670;&nbsp;</a></span>p</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../dc/d84/group__core__basic.html#ga1e83eafb2d26b3c93f09e8338bcab192">Point</a> cv::LineIterator::p</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a364babc688c58ba62ea0cad61a65f07b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a364babc688c58ba62ea0cad61a65f07b">&#9670;&nbsp;</a></span>plusDelta</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int cv::LineIterator::plusDelta</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="ad750408a2774a499f6b08045f7b8e59e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad750408a2774a499f6b08045f7b8e59e">&#9670;&nbsp;</a></span>plusShift</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int cv::LineIterator::plusShift</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="adb7f1c0c3e722d9e87230b92e7b9f773"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adb7f1c0c3e722d9e87230b92e7b9f773">&#9670;&nbsp;</a></span>plusStep</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int cv::LineIterator::plusStep</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a6fe1f4e8d925bf60ca35255d765d83d1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6fe1f4e8d925bf60ca35255d765d83d1">&#9670;&nbsp;</a></span>ptmode</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool cv::LineIterator::ptmode</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a9fc3f91adc5a20c6841c083cc89178d3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9fc3f91adc5a20c6841c083cc89178d3">&#9670;&nbsp;</a></span>ptr</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../d1/d1b/group__core__hal__interface.html#ga65f85814a8290f9797005d3b28e7e5fc">uchar</a>* cv::LineIterator::ptr</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="acc76bbdcf947d3040d9b6d0e0ca27714"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acc76bbdcf947d3040d9b6d0e0ca27714">&#9670;&nbsp;</a></span>ptr0</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="../../d1/d1b/group__core__hal__interface.html#ga65f85814a8290f9797005d3b28e7e5fc">uchar</a>* cv::LineIterator::ptr0</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="ad01672bb85b10aff6f89dfcd93b618f5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad01672bb85b10aff6f89dfcd93b618f5">&#9670;&nbsp;</a></span>step</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int cv::LineIterator::step</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>opencv2/<a class="el" href="../../d1/d4f/imgproc_2include_2opencv2_2imgproc_8hpp.html">imgproc.hpp</a></li>
</ul>
</div><!-- contents -->
<!-- HTML footer for doxygen 1.8.6-->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Apr 2 2021 11:36:43 for OpenCV by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="../../doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
<script type="text/javascript">
//<![CDATA[
addTutorialsButtons();
//]]>
</script>
</body>
</html>
